import { createApp } from 'vue'
import App from './App.vue'
import router from './router' // 导入路由实例
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus' // 引入 Element Plus
import 'element-plus/dist/index.css' // 引入 Element Plus 样式
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
// 注册 Element Plus
app.use(ElementPlus)

// 注册图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 挂载路由实例
app.use(router)

app.use(createPinia())

// 挂载应用
app.mount('#app')
